#ifndef LOGIN_H
#define LOGIN_H

#include<QDialog>
#include<QPoint>
#include<QTimer>
#include"src/loadingwidget.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Login; }
QT_END_NAMESPACE

class Login : public QDialog
{
    Q_OBJECT

public:
    Login(bool firstLogin,QWidget *parent = nullptr);
    ~Login();

protected:
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseMoveEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);

//    virtual void closeEvent(QCloseEvent *event);
//    virtual void paintEvent(QPaintEvent* event);

private slots:
    void on_pushButton_2_clicked();
    void LogMainSlots();
    void autoLogin();

//    void LogMainSlots();
//    void ChangeRemberStateSlots(int);

private:
    Ui::Login *ui;

    void saveSetting();

    bool firstLogin;
    bool mMoveing;
    QPoint mMovePosition;

    int passwordIsTrue(QString workNumber,QString password);

    QString m_NameStr;
    QString m_PasStr;
    bool m_isRember;
    bool m_isAutoLog;

    QTimer *t;
    QTimer *tClear;
};
#endif // LOGIN_H
